////<!-- 告警记录 -->
import api from '../../../fetch/api'

export default {
  data() {
    return {
    };
  },
  created() {
  },
  methods: {
    getList() {
      let params = $.extend({}, this.searchParams, this.otherParams);
      this.getItemList(params);
    },
    //获取列表
    getItemList(aparams) {
      let self = this,
        params = {
          page: self.pageNumber,
          pageSize: self.pageSize
        };
      params = $.extend({}, params, aparams);
      api.fetchGet('park/emergency/record/list.do', params)
        .then(res => {
          let data = res.data;
          self.tbodysInfo = data.rows;
          self.total = data.total;
        }, err => {});
    },
    exportData() {
      let self = this;
      let theadsArr = []
      for(let i = 0; i<self.theadsInfo.length; i++){
        if(self.theadsInfo[i].checked){
          theadsArr.push(self.theadsInfo[i].prop)
        }
      }
      let params = {
        meterList: theadsArr.join(',')
      };

      params = $.extend({}, params, this.searchParams, this.otherParams);
      self.showDialog("确认导出该报表?", '', function () {
        self.toExportAsync('park/emergency/record/export.do', params);
      });
    }
  }
}
